
let mysql =  require('mysql');
let modle = {
    select:function(sql){
        return new Promise((resolve,reject)=>{
            let connection = mysql.createConnection({host:'localhost',user:'root',password:'root',port:'3306',database:"yiqing"});
            connection.connect();
            connection.query(sql,function(err,data){
                if(err){
                    reject(err);
                }else{
                    resolve(data);
                }
            })
        })
    }
}
 
module.exports =  modle ;
